local Timer = @@lib(hump.timer)
local Queue = @@src(queue)

local BUA = @@CLASS("BasicUnitAI")


BUA.think = function (self)
   self.unit._draw_state:show_think()
   if self.unit:get_next_path_point() and self.unit:get_velocity_length() == 0 then
      local point = self.unit:get_next_path_point()
      local ux, uy = self.unit:get_position()
      self.unit:start_movement()
   end
end

BUA.start = function (self, unit)
   self.unit = unit
   if self.timer then self.timer:clear() else self.timer = Timer.new() end
   self.timer:every(1.33, function () self:think() end)
end

BUA.update = function (self, dt)
   self.timer:update(dt)
end

return BUA
